<?php namespace app\home\controller;

class Entry extends Common {
	public function index() {
	   //网站标题
	    $headConf=['title'=>'个人博客--首页'];
	    View::with('headConf',$headConf);
	    //新闻展示
	    $articleData=Db::table('article')->join('category','category_cid','=','cid')->field('aid,title,sendtime,author,digest,thumb,cid,cname')->where('is_recycle',0)->limit(5)->get();
	    foreach ($articleData as $k=>$v){
	       $articleData[$k]['tag']=Db::table('tag')->join('article_tag','tag_tid','=','tid')->where('article_aid',$v['aid'])->lists('tid,tname');
		}
//	    p($articleData);
	   View::with('articleData',$articleData);
		return view();
	}
}